//
//  WVAReceiveApplicantViewController.m
//  WeChatBuniess
//
//  Created by Li Guo Ping on 2017/12/22.
//  Copyright © 2017年 GR Harry. All rights reserved.
//

#import "WVAReceiveApplicantViewController.h"
#import "WCBDataSourceGenerator.h"
#import "TFDataCaptureManager.h"

@interface WVAReceiveApplicantViewController ()<WCBDataSourceGeneratorDelegate>
@property (nonatomic, strong) TFDataCaptureManager     *dataCaptureManager;
@property (nonatomic, strong) WCBDataSourceGenerator   *dataSourceGenerator;
@end

@implementation WVAReceiveApplicantViewController

- (void)viewDidLoad {
    [super viewDidLoad];
    self.dataCaptureManager = [TFDataCaptureManager sharedInstance];
    self.dataSourceGenerator = [WCBDataSourceGenerator sharedInstance];
    self.dataSourceGenerator.delegate = self;
    [self.dataSourceGenerator begin];
}

//MARK: - WCBDataSourceGeneratorDelegate
- (void)generateDataWithItems:(NSArray<WCDataItem *> *)dataItems {
    [dataItems enumerateObjectsUsingBlock:^(WCDataItem * _Nonnull item, NSUInteger idx, BOOL * _Nonnull stop) {
        [self.dataCaptureManager.capturer updateWCDataItem:item withItemId:item.itemId];
    }];
}

- (void)generateCompletion {
    [self.dataCaptureManager.capturer reciveDataComplate];
}



@end
